#include<stdio.h>
/*int main()
{
    int n;
    char ch;
    for(ch=getchar();ch!='\n';n++);
    printf("%d",n);
    return 0;;
}*/
int main()
{
int m, n;
printf("Enter m,n;");
scanf("%d%d", &m,&n);
while (m!=n) //1
{
while(m>n) m=m-n; //2
while(n>m) n=n-m; //3
}
printf("m=%d\n",m);
return 0;
}